/**
 * Created by Ashe on 2016-04-11.
 */
$(document).ready(function(){
   // $(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})


    //选择多条记录
    getCheck=function(obj1){
        var check=$(obj1).attr("checked");
        if(check == undefined || check == "undefined"){
            $(obj1).attr("checked","checked");
        } else{
            $(obj1).removeAttr("checked");
        }
    }



});

function GetQueryString(name)
{
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r!=null) {
        return unescape(r[2]);
    }else{
        return null;
    }
}
function getUUID(){
    return Math.uuid();
}

function getIP(){
    return "localhost:3000/";
}

function getCheckData(){
    var params="";
    $("input[dote='checkbox']").each(function(){
        var check=$(this).attr("checked");
        var id=$(this).attr("id");
        if(check == "checked"){
            params+=id+",";
        }
    })
    params=params.substring(0,params.length-1);
    return params;
}

function getcheckdataJson(roleId){
    var params=[];
    $("input[dote='checkbox']").each(function(){
        var check=$(this).attr("checked");
        var id=$(this).attr("id");
        if(check == "checked"){
           var paramT={"id":utils.getUUID(),"roleId":roleId,"menuId":id};
            params.push(paramT);
        }
    })
    return JSON.stringify(params);
}